﻿/*
 * This file is part of CommunitySettlers.
 *
 * CommunitySettlers is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * CommunitySettlers is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with CommunitySettlers.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Author: Christoph Husse
 * 
 * Also checkout our homepage: http://communitysettlers.codeplex.com/
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GameHostService
{
    public class PlayerSession : IDisposable
    {
        /// <summary>
        /// This is the session credential token. Anyone who knows it threated as session owner!
        /// </summary>
        public Guid SessionID { get; private set; }
        /// <summary>
        /// This is the session masked token. It internally maps to the associated session but has
        /// no value to third parties, since it can only be used to reference a player, but not to
        /// impersonate.
        /// </summary>
        public Guid MaskedID { get; private set; }
        public GameSession Game { get; set; }

        public PlayerSession()
        {
            SessionID = Guid.NewGuid();

            byte[] masked = SessionID.ToByteArray();

            for(int i = 0; i < 8; i++){
                masked[i] = 0;
            }

            MaskedID = new Guid(masked);
        }

        public void Touch()
        {

        }

        public void Dispose()
        {
        }
    }
}